package com.selfdriving.adapter;

import java.util.List;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter {
	private Context context;

	private List<Bitmap> bitmaps;

	public ImageAdapter(Context context, List<Bitmap> bitmaps) {
		this.context = context;
		this.bitmaps = bitmaps;
	}

	@Override
	public int getCount() {
		return bitmaps.size();
	}

	@Override
	public Object getItem(int poistion) {
		return bitmaps.get(poistion);
	}

	@Override
	public long getItemId(int poistion) {
		return poistion;
	}

	@Override
	public View getView(int poistion, View view, ViewGroup arg2) {
		Bitmap bitmap = bitmaps.get(poistion);
		ImageView image = new ImageView(context);
		image.setImageBitmap(bitmap);
		return image;
	}

}